package com.authine.cloudpivot.ext.enums.order;

/**
 * Created by Kris on 2019/3/25
 */
public enum StockBillStatusEnum {

    ALL(0, "全部"),
    WOKING(1, "已盘点"),
    CLOSED(2, "已关闭"),
    PM_CHECK(3, "待平台审核"),
    CUSTOMER_CHECK(4, "待客户审核");

    public Integer id;
    public String text;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    StockBillStatusEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static StockBillStatusEnum get(Integer code) {

        for (StockBillStatusEnum c : StockBillStatusEnum.values()) {
            if (c.id.toString().equals(code.toString())) {
                return c;
            }
        }
        return null;
    }

    public static StockBillStatusEnum get(String name) {

        for (StockBillStatusEnum c : StockBillStatusEnum.values()) {
            if (c.name().equals(name)) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}
